<include file="Public/head"/>
<link href="__PUBLIC__/layui/css/layui.css" rel="stylesheet" type="text/css" />
<!-- <script src="__PUBLIC__/layui/layui.js"></script> -->
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
<style>
th{
    font-size:19px;
    color:#000;
}
#wcai th{
    font-size: 18px;
    color:#000;
}
#wcai td{
    font-size: 15px;
    /*color:#000;*/
}
</style>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }

    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                    <div class="row">
                    <div class="col-xs-12">
                        <div style="width:100%;margin-top:5px;">
                            <button class="layui-btn layui-btn-big layui-btn-normal" onclick="ji()">集团职能中心</button>
                            <button class="layui-btn layui-btn-big layui-btn-danger" onclick="wang()">集团网络中心</button>
                            <!-- <button class="layui-btn layui-btn-big " onclick="yi()">医院</button> -->
                        </div>
    
                        <div style="width:100%;height:1px;background-color:#000;margin-top:10px;"></div>

                        <!-- <div></div> -->
                        <table class="table table-hover"  id="wcai" >
                            <thead>
                                <tr>
                                    <!-- <th class="center"><input class="check-all" type="checkbox" value=""></th> -->

                                    <!-- <th class="center">id</th> -->
                                    <th class="center" style="width:20px;">
                                          <!-- <div class="layui-form-item"> -->
                                            <!-- <label class="layui-form-label">单行选择框</label> -->
                                            <div class="layui-input-block" style="width:100px;margin-left:1%;" >
                                              <select name="interest" lay-filter="aihao" id="one">
                                                <!-- <option value="0">选择表格..</option> -->
                                                <option value="0">未评分表格</option>
                                                <option value="1">已评分表格</option>
                                                
                                              </select>
                                            </div>
                                          <!-- </div> -->
                                    </th>
                                    <th class="center" style="margin-left:80%;">姓名</th>
                                    <th class="center">
                                        <div class="layui-input-block" style="width:100px;margin-left:30%;" >
                                          <select name="interest" lay-filter="aihao" style="text-align:center" id="tow">
                                                <option value="0">绩效月</option>
                                            <volist name="j_yue" id="j">
                                                
                                                <option value="{$j.k_time}">{$j.k_time}</option>
                                            </volist>
                                            
                                           
                                            
                                          </select>
                                        </div>

                                    </th>
                                    <th class="center">截止时间</th>
                                    <th class="center">所属部门/岗位</th>
                                    <!-- <th class="center">所属岗位</th> -->
                                    <!-- <th class="center">战略目标</th> -->
                                    <th class="center">衡量指标</th>
                                    <!-- <th class="center">权重</th> -->
                                    <!-- <th class="center">目标值</th> -->
                                    <!-- <th class="center">计分规则</th> -->
                                    <th class="center">指标核算结果</th>
                                   <!--  <th class="center">标准分</th>
                                    <th class="center">考核得分</th> -->
                                    <th class="center">操作</th>
                                </tr>
                            </thead>
                            <tbody id="trl">
                                <?php if($empty == 0): ?>
                                    <tr>
                                        <td colspan="14" class="center" style="font-size:19px;">暂无考核表</td>
                                    </tr>
                                <?php else: ?>
                                    <volist name="list" id="v">
                                        <!-- <form action="" id="formid"></form> -->
                                            <tr>
                                                <td class="center" style="color:#00a497">未评分</td>
                                               <!--  <td class="center">
                                                    <input class="uids" type="checkbox" name="uids[]" value="{$v['id']}">
                                                </td> -->
                                                <!-- <td class="center">{$v.pid}</td> -->
                                                <td class="center">{$v.uname}</td>
                                                <td class="center"> {$v.k_time}</td>
                                                <td class="center"> {$v.e_time}</td>
                                                <td class="center">{$v.ment}</td>
                                                <!-- <td class="center"><b>{$v.target}</b></td> -->
                                                <td class="center"><b>{$v.norm}</b></td>
                                                <!-- <td class="center"><b>{$v.weight}</b></td> -->
                                                <!-- <td class="center"><b>{$v.value}</b></td> -->
                                                <!-- <td class="center"><b>{$v.rule}</b></td> -->
                                                <td style="display:none">{$v.uname}</td>
                                                <td style="display:none">{$v.yue}</td>
                                                <?php if($v['result'] != '' ): ?>
                                                    <td class="center" style="color:#00a497">{$v.result}</td>
                                               <!--      <td class="center" style="color:#00a497">{$v.standard}</td>
                                                    <td class="center" style="color:#00a497">{$v.score}</td> -->
                                                    <td class="center" style="color:#00a497">√已評分</td>
                                                    
                                                <?php else: ?>
                                                    <td class="center" ><input type="text" style="width:90px;"></td>
                                                   <!--  <td class="center"><input type="text" style="width:90px;"></td>
                                                    <td class="center"><input type="text" style="width:90px;"></td> -->
                                                    <td class="center"><div onclick="ti({$v.pid},this)" class="layui-btn layui-btn-danger layui-btn-radius">提交</div></td>
                                                <?php endif ?>
                                                <!-- <td class="center">{$v.post}</td> -->
                                               
                                                
                                               
                                            </tr>  
                                        <!-- </form> -->
                                    </volist>
                                <?php endif ?>
                                
                            </tbody>
                        </table>









 
                    </div>
                    </div>
                    
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<!-- <script src="__PUBLIC__/qwadmin/js/function.js"></script> -->
<!-- <script src="__PUBLIC__/layer/layer.js"></script> -->
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
//给下拉框设置事件
$("#tow").change(function(){
    
    var yue = this.value;
    var type = $('#one').val();
    // console.log(xuan);
     //询问框
    $.ajax({
         type: "POST",
         url:"{:U('cha')}",
         data:{"yue":yue,"type":type},// 要提交的表单 
         beforeSend:function(){
               layer.load(0, {shade: false});
            },
         success: function(data) {
            if (data != '2222') {
                 $('td').remove();
                        
                    for (var i = 0; i < data.length; i++) {
                        if (data[i].zt != '1') {
                             // console.log(data);
                            $("<tr><td class='center' style='color:#00a497'>未评分</td><td class='center'>"+data[i].uname+"</td><td class='center'>"+data[i].k_time+"</td><td class='center'>"+data[i].e_time+"</td><td class='center'>"+data[i].ment+"</td><td class='center'>"+data[i].norm+"</td><td class='center' style='display:none;'>"+data[i].uname+"</td><td class='center' style='display:none;'>"+data[i].yue+"</td><td class='center'><input type='text' style='width:50px;'></td><td class='center'><button class='layui-btn layui-btn-danger layui-btn-radius' onclick='ti("+data[i].pid+",this)'>提交</button></td></tr>").appendTo('#wcai');
                            // $('#bfan').show();
                            // $('#bfen').hide();
                        }else{
                            $("<tr><td class='center' style='color:#00a497'>√已评分</td><td class='center'>"+data[i].uname+"</td><td class='center'>"+data[i].k_time+"</td><td class='center'>"+data[i].e_time+"</td><td class='center'>"+data[i].ment+"</td><td class='center'>"+data[i].norm+"</td><td class='center' style='display:none;'>"+data[i].uname+"</td><td class='center' style='display:none;'>"+data[i].yue+"</td><td class='center' style='color:#00a497'>"+data[i].result+"/%</td><td class='center'></td></tr>").appendTo('#wcai');
                        }
                       
                    }
            }else{
                $('td').remove();
                $("<td class='center' colspan='8' id='lmei'><h1 style='font-size:25px;'>没有搜索到!!!</h1></td>").appendTo('#trl');
            }
         },
         complete: function() {
                 layer.closeAll('loading');
            }
     });
   
})
// $("#one").change(function(){
    
//     var type = this.value;
//     var yue = $('#tow').val();
//     // console.log(yue);
//      //询问框
//     $.ajax({
//          type: "POST",
//          url:"{:U('chaa')}",
//          data:{"yue":yue,"type":type},// 要提交的表单 
//          beforeSend:function(){
//                layer.load(0, {shade: false});
//             },
//          success: function(data) {
//             if (data != '2222') {
//                  $('td').remove();
                        
//                     for (var i = 0; i < data.length; i++) {
//                         // console.log(data);
//                         $("<tr><td class='center' style='color:#00a497'>√已评分</td><td class='center'>"+data[i].uname+"</td><td class='center'>"+data[i].k_time+"</td><td class='center'>"+data[i].e_time+"</td><td class='center'>"+data[i].ment+"</td><td class='center'>"+data[i].norm+"</td><td class='center' style='display:none;'>"+data[i].uname+"</td><td class='center' style='display:none;'>"+data[i].yue+"</td><td class='center' style='color:#00a497'>"+data[i].result+"/%</td><td class='center'></td></tr>").appendTo('#wcai');
//                         // $('#bfan').show();
//                         // $('#bfen').hide();
//                     }
//             }
//          },
//          complete: function() {
//                  layer.closeAll('loading');
//             }
//      });
   
// })
function ji()
{
    location.href="{:U('cai')}";
}
// function yi()
// {
//     $('#formid2').show();
//     $('#formid').hide();
//     $('#wcai').hide();
// }



function ti(id,obj)
{   
    //衡量结果得分
    var result = $(obj).parent().prev().children().val();
   
    //绩效月
    var uname = $(obj).parent().prev().prev().prev().text();
    //被評分人
    var yue = $(obj).parent().prev().prev().text();

    //询问框
    layer.confirm('确定提交么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('wcai')}",
             data:{"id":id,"result":result,'yue':yue,'uname':uname},// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                // console.log(msg);
                if (msg != null) {
                    layer.msg('添加成功~', {icon: 1});
                    history.go(0);
                    // $(this).parent().prev().text(msg);
                }else{
                    if (msg == '分数为空') {
                        layer.msg('分数不能为空', {icon: 2});
                    }else{
                        layer.msg('添加失败！', {icon: 2});
                    }
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
         });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });   
   
}

</script>
</body>
</html>



